package com.example.text.service;



import com.example.text.entity.Result;
import com.example.text.entity.Ware;
import com.example.text.mapper.WareMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WareService {
    @Autowired
    WareMapper wareMapper;

    public Result insertWare(Ware ware) {
        wareMapper.insert(ware);

        return Result.success();

    }

    public void updateWare(Ware ware) {
        wareMapper.updateWare(ware);
    }


    public void deleteWare(Integer wareId) {
        wareMapper.deleteWare(wareId);

    }

    public List<Ware> selectAllWare() {
        return wareMapper.selectAllWare();
    }

    public Ware selectWareById(Integer wareId) {
        return wareMapper.selectWareById(wareId);
    }

    public List<Ware> selectWareByName(String wareName) {
        return wareMapper.selectWareByName(wareName);
    }
}
